package generator

import "beergo/plugins/maker"

func init() {
	DoctorQuestion()
	QuestionAnswers()
}

func DoctorQuestion() {
	c := maker.CreateTable("DoctorQuestion","用户提问","check")
	c.AddManyToOne("user","发起人","sys.User").SetSrcDir("sys")
	c.AddTitle()
	c.AddContent()
	c.AddJson("pics","图片")
	c.AddInt("replyCount","回复数量")
	c.AddCreateAt()
	c.AddUpdateAt()
	c.AddOneToMany("answers","回复","QuestionAnswers")
	c.Generate()
}
func QuestionAnswers() {
	c := maker.CreateTable("QuestionAnswers","专家答复","check")
	c.AddManyToOne("question","问题","DoctorQuestion")
	c.AddManyToOne("doctor","所属专家","Doctor")
	c.AddTitle()
	c.AddContent()
	c.AddJson("pics","图片")
	c.AddCreateAt()
	c.AddUpdateAt()
	c.Generate()
}
